StreamNOP is a sample STREAMS module that was designed for you to use as a template when creating STREAMS modules. The template demonstrates the following features:
1. An empty STREAMS module that does nothing to messages that pass through it.
2. Set up for using "OTDebug.h".
3. Set up for Instrumentation using the Instrumentation SDK.
4. My standard technique for getting per-stream data.
5. All my standard asserts.
StreamNOP is largely derived from the TPIFile source, but it is simplified to the point where it makes a useful template.
Packing List
The StreamNOP package contains the following items:
• Read Me About StreamNOP — This document.
• StreamNOP.µ — A PPC project file to build the “StreamNOP” module.
• StreamNOP — A compiled version of the StreamNOP.µ project.
• StreamNOP.c — Source to the StreamNOP module.
Installation and Execution
To test the sample, do the following:
1. Drag the “StreamNOP” module into your Extensions folder.
2. You can now open a stream using the following code snippet and StreamNOP will be inserted in the stream:
ep = OTOpenEndpoint(OTCreateConfiguration("StreamNOP,tcp"), …);
Building the Sample
This sample was built using the Metrowerks CodeWarrior Pro 2 environment and the Open Transport 1.3 SDK interfaces and libraries.
To rebuild the sample, first open the project and change the “LatestInterfaces” and “LatestLibraries” access paths to point to the interfaces and libraries from the OT 1.3 (or newer) SDK. Then choose Make from the Project menu to build the StreamNOP module.
Credits and Version History
If you find any problems with this sample, mail <DTS@apple.com> with “Attn: Quinn” as the first line of your mail and I’ll try to fix them up.
Version 1.0b1 (Aug 1997) is the first release.
Version 1.0b2 (Jul 1998) is an update to the CodeWarrior Pro 2 environment with OT 1.3 interfaces and libraries. This was prompted by the problems CodeWarrior has converting projects with “.exp” files. I now use #pragma export instead of a “.exp” file. There are no code changes.